﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Donate.DAl;


namespace  Donate
{
    public partial class LoginForm : Form
    {
        public LoginForm()
        {
            InitializeComponent();
        }
        private void clearForm()
        {
            txtPassword.Text = "";
            txtName.Text = "";
        }

        private void button1_Click(object sender, EventArgs e)
        {
            List<userNameEntity> list = userNames.GetByMemNameAndId(txtName.Text,txtPassword.Text);
            if (list.Count != 0)
            {
                Donors form = new Donors();
                form.Show();
               // this.Visible = false;
                clearForm();
                linkLabel1.Enabled = true;
            }
            else
            {
                MessageBox.Show("خطأ فى بيانات الدخول");
            }

        }

        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            userName user = new userName();
            user.Show();

        }


       
    }
}
